<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>商家订单</title>
<link rel="stylesheet" type="text/css" href="#{$smarty.const.APP}#/View/template/home/css/hui.css" />
</head>
<body>
<header class="hui-header">
  <div id="hui-back"></div>
  <h1>商家订单</h1>
</header>
<div class="hui-common-title"> </div>
<div class="hui-tab">
  <div class="hui-tab-title">
    <div>待发货</div>
    <div>待收货</div>
    <div>已完成</div>
	 <div>交易记录</div>
  </div>
  <div class="hui-tab-body">
    <div class="hui-tab-body-items">
      <div class="hui-tab-item hui-list"> #{foreach from=$list_1 key=k item=v}#
        <div class="hui-list">
          <div class="hui-row">
            <div class="hui-col-7"><a href="#{$smarty.const.ACT}#/home/WxProductOrder/product_order_shop_info/id/#{$v.id}#/">#{$v.name}#</a></div>
            <div class="hui-col-5"> #{$v.adt}#</div>
          </div>
          <div class="hui-row">
            <div class="hui-col-7 hui-font-gray">数量：#{$v.number}#金额：#{$v.money}#</div>
            <div class="hui-col-5 hui-font-red"><span class="hui-icons hui-icons-loading" onclick="javascript:product_send('#{$v.id}#','2')">确认发货</span></div>
          </div>
        </div>
        #{/foreach}# </div>
		<div class="hui-tab-item hui-list"> #{foreach from=$list_2 key=k item=v}#
        <div class="hui-list">
          <div class="hui-row">
            <div class="hui-col-7"><a href="#{$smarty.const.ACT}#/home/WxProductOrder/product_order_shop_info/id/#{$v.id}#/">#{$v.name}#</a></div>
            <div class="hui-col-5"> #{$v.adt}#</div>
          </div>
          <div class="hui-row">
            <div class="hui-col-7 hui-font-gray">数量：#{$v.number}#金额：#{$v.money}#</div>
            <div class="hui-col-5 hui-font-red"><span class="hui-icons hui-icons-loading">待收货</span></div>
          </div>
        </div>
        #{/foreach}# </div>
		<div class="hui-tab-item hui-list"> #{foreach from=$list_3 key=k item=v}#
        <div class="hui-list">
          <div class="hui-row">
            <div class="hui-col-7"><a href="#{$smarty.const.ACT}#/home/WxProductOrder/product_order_shop_info/id/#{$v.id}#/">#{$v.name}#</a></div>
            <div class="hui-col-5"> #{$v.adt}#</div>
          </div>
          <div class="hui-row">
            <div class="hui-col-7 hui-font-gray">数量：#{$v.number}#金额：#{$v.money}#</div>
            <div class="hui-col-5 hui-font-red"><span class="hui-icons hui-icons-check" onclick="javascript:product_send('#{$v.id}#','2')">确认发货</span></div>
          </div>
        </div>
        #{/foreach}# </div>
		<div class="hui-tab-item hui-list"> #{foreach from=$list_4 key=k item=v}#
        <div class="hui-list">
          <div class="hui-row">
            <div class="hui-col-4">余额：+#{$v.balance_in}#</div>
            <div class="hui-col-3">积分：+#{$v.integral_in}#</div>
            <div class="hui-col-5"> #{$v.adt}#</div>
          </div>
        </div>
        #{/foreach}# </div>
    </div>
  </div>
</div>
<script src="#{$smarty.const.APP}#/View/template/home/js/hui.js" type="text/javascript" charset="utf-8"></script> 
<script src="#{$smarty.const.APP}#/View/template/home/js/hui-tab.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
<script type="text/javascript">
hui.tab('.hui-tab');

function product_send(id,status){
	hui.ajax({
		type : 'POST',
		url : '#{$smarty.const.ACT}#/home/WxProductOrder/product_order_send/',
		data : {id:id,status:status},
		backType:'json',
		beforeSend : function(){hui.loading();},
		complete : function(){hui.closeLoading();},
		success : function(data){
			if(data.code=='sucess'){
				//hui.upToast(data.message);
				hui.toast('操作成功', 'success');
				var url="#{$smarty.const.ACT}#/home/WxProductOrder/product_order_shop/";
				window.location.href=url;
			}else{
				hui.upToast(data.message);
			}
		},
		error : function(e){
			console.log(JSON.stringify(e));
			hui.iconToast('读取消息失败', 'warn');
		}
	});
}
	
</script>